package com.bean;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;

public class Comment {
    /**
     * 评论楼层数
     */
    @NotNull
    int level;
    /**
     * 评论对应的帖子
     */
    @NotNull
    Post post;
    /**
     * 评论的人
     */
    @NotNull
    User poster;
    /**
     * 评论内容
     */
    @NotNull
    @Size(min = 1,max = 200)
    String content;
    /**
     * 跟帖时间
     */
    @NotNull
    Date commentTime;

    /**
     * 根据 level，post，poster，connent 的内容创建Admin对象
     * @param level
     * @param post
     * @param poster
     * @param content
     */
    public Comment(int level, Post post, User poster, String content,Date commentTime) {
        this.level = level;
        this.post = post;
        this.poster = poster;
        this.content = content;
        this.commentTime = commentTime;
    }
    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }

    public Post getPost() {
        return post;
    }

    public void setPost(Post post) {
        this.post = post;
    }

    public User getPoster() {
        return poster;
    }

    public void setPoster(User poster) {
        this.poster = poster;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Date getCommentTime() {
        return commentTime;
    }

    public void setCommentTime(Date commentTime) {
        this.commentTime = commentTime;
    }
}
